import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
    ...App
})
app.$mount()
/*  backpage : 登录后返回的页面
	backtype : 打开页面的类型[1 : redirectTo 2 : switchTab] */
Vue.prototype.checkLogin = function(backpage, backtype){
	var SNAME = uni.getStorageSync('SNAME');
	var OPENID = uni.getStorageSync('OPENID');
	var SFACE = uni.getStorageSync('SFACE');
	// 如果没有登录,就返回false
	if(SNAME == '' || OPENID == '' || SFACE == ''){
			uni.redirectTo({url:'../login/login?backpage='+backpage+'&backtype='+backtype});
			return false;
		}
		// 已经登录返回数组 [用户 id, 用户随机码, 用户昵称, 用户表情]
		return [SNAME, OPENID, SFACE];
}
var APITOKEN  = 'api2018';
Vue.prototype.apiServer = 'http://192.168.2.142:8080/uni/';
Vue.prototype.staticServer = 'http://192.168.2.213:80/images';
